package com.example.qu_tao.entity;

import java.util.ArrayList;
import java.util.List;

public class Goods {



    private int goods_id;
    private String goods_name;
    private  double goods_price;
    private double goodsFreight;
    private String goodsAddress;
    private String unit;
    private int goods_number;
    private String goods_content;
    private List<Photo> photoList;

    public int getGoods_id() {
        return goods_id;
    }

    public void setGoods_id(int goods_id) {
        this.goods_id = goods_id;
    }

    public String getGoods_name() {
        return goods_name;
    }

    public void setGoods_name(String goods_name) {
        this.goods_name = goods_name;
    }

    public double getGoods_price() {
        return goods_price;
    }

    public void setGoods_price(double goods_price) {
        this.goods_price = goods_price;
    }

    public double getGoodsFreight() {
        return goodsFreight;
    }

    public void setGoodsFreight(double goodsFreight) {
        this.goodsFreight = goodsFreight;
    }

    public String getGoodsAddress() {
        return goodsAddress;
    }

    public void setGoodsAddress(String goodsAddress) {
        this.goodsAddress = goodsAddress;
    }

    public int getGoods_number() {
        return goods_number;
    }

    public void setGoods_number(int goods_number) {
        this.goods_number = goods_number;
    }

    public String getGoods_content() {
        return goods_content;
    }

    public void setGoods_content(String goods_content) {
        this.goods_content = goods_content;
    }



    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public List<Photo> getPhotoList() {
        return photoList;
    }

    public void setPhotoList(List<Photo> photoList) {
        this.photoList = photoList;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "goods_id=" + goods_id +
                ", goods_name='" + goods_name + '\'' +
                ", goods_price=" + goods_price +
                ", goodsFreight=" + goodsFreight +
                ", goodsAddress='" + goodsAddress + '\'' +
                ", unit='" + unit + '\'' +
                ", goods_number=" + goods_number +
                ", goods_content='" + goods_content + '\'' +
                ", photoList=" + photoList +
                '}';
    }
    public void addPhoto (Photo photo){
        if (photoList == null){
            photoList = new ArrayList<>();
        }
        photoList.add(photo);
    }
}
